package com.wlyuan.open.application.translator;

import com.wlyuan.open.domain.qrcode.QrCode;
import com.wlyuan.open.domain.qrcode.QrCodeDetail;
import com.wlyuan.open.vo.OpenQrCodeDetailVO;
import com.wlyuan.open.vo.OpenQrCodeVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author lijing
 */
public class OpenQrCodeTranslator {

    @Mapper
    public interface Translator {

        OpenQrCodeVO translate(QrCode source);

        OpenQrCodeDetailVO translate(QrCodeDetail source);

    }

    private static final Translator TRANSLATOR = Mappers.getMapper(Translator.class);

    public static OpenQrCodeVO translate(QrCode source) {
        return TRANSLATOR.translate(source);
    }

    public static OpenQrCodeDetailVO translate(QrCodeDetail source) {
        return TRANSLATOR.translate(source);
    }
}
